package pers.twm.mybatis.executor;

import javax.swing.*;

import org.jetbrains.annotations.NotNull;

import com.intellij.execution.Executor;
import com.intellij.execution.ExecutorRegistry;
import pers.twm.mybatis.util.IconsUtil;

import static pers.twm.mybatis.constant.Constant.DESCRIPTION;

/**
 * @Author twm
 * @Date 2023/2/26 16:29
 * @Param 
 * @return
 **/
public class SqlLogExecutor extends Executor {

    public static final String TOOL_WINDOW_ID = "SQL Log Plugin";

    @Override
    public @NotNull String getToolWindowId() {
        return TOOL_WINDOW_ID;
    }

    @Override
    public @NotNull Icon getToolWindowIcon() {
        return getIcon();
    }

    @Override
    public @NotNull Icon getIcon() {
        return IconsUtil.MY_BATIS;
    }

    @Override
    public Icon getDisabledIcon() {
        return IconsUtil.MY_BATIS;
    }

    @Override
    public String getDescription() {
        return DESCRIPTION;
    }

    @NotNull
    @Override
    public String getActionName() {
        return getDescription();
    }

    @NotNull
    @Override
    public String getId() {
        return TOOL_WINDOW_ID;
    }

    @NotNull
    @Override
    public String getStartActionText() {
        return getDescription();
    }

    @Override
    public String getContextActionId() {
        return getDescription();
    }

    @Override
    public String getHelpId() {
        return TOOL_WINDOW_ID;
    }

    public static Executor getInstance() {
        return ExecutorRegistry.getInstance().getExecutorById(TOOL_WINDOW_ID);
    }
}